#ifndef WINDOW_H
#define WINDOW_H

#include <QtOpenGL/QGLWidget>
#include <QtCore/QTimer>

#include <view/scenerenderer.h>
#include <control/gamehandler.h>
#include <control/keyboardplayercontrol.h>
#include <control/nullplayercontrol.h>

namespace Ui {
class Window;
}

class Window : public QGLWidget
{
    Q_OBJECT

public:
    explicit Window(QWidget *parent = 0);
    ~Window();

protected:
    void initializeGL();
    void paintGL();
    void resizeGL(int w, int h);

    void keyPressEvent(QKeyEvent *);
    void keyReleaseEvent(QKeyEvent *);
    
private:
    static const int TIMER_INTERVAL = 10;

    Ui::Window *ui;
    int _width;
    int _height;
    GameHandler _gameHandler;
    KeyboardPlayerControl _keyboardControl;
    NullPlayerControl _nullControl;
    SceneRenderer _renderer;
};

#endif // WINDOW_H
